import type { RouteRecordRaw } from 'vue-router'
import { HOME_PAGE_URL, DEFAULT_LAYOUT, LOGIN_PAGE_URL, REDIRECT_PAGE_URL, LAYOUT_NAME, HOME_PAGE_NAME } from './router.constant'

/**
 * 静态路由表配置
 *  - https://gitee.com/y_project/RuoYi-Vue/blob/master/ruoyi-ui/src/router/index.js
 *  - https://gitee.com/un-pany/v3-admin-vite/blob/main/src/router/index.ts
 */
export const STATIC_ROUTE_LIST: Array<RouteRecordRaw> = [
  {
    path: '', // 布局路由配置 确保可以显示布局框架
    name: LAYOUT_NAME,
    component: DEFAULT_LAYOUT,
    redirect: HOME_PAGE_URL,
    children: [
      {
        path: HOME_PAGE_URL,
        name: HOME_PAGE_NAME,
        component: () => import('@/views/Dashboard/index.vue'),
        meta: { title: '主控台', icon: 'Home', full: false, affix: true },
      },
    ],
  },

  {
    path: '/User',
    component: DEFAULT_LAYOUT,
    children: [
      {
        path: 'Profile',
        name: 'Profile',
        component: () => import('@/views/System/User/Profile.vue'),
        meta: { title: '个人中心', icon: 'user', hidden: true },
      },
    ],
  },

  {
    path: LOGIN_PAGE_URL, // 系统登录页
    name: 'Login',
    component: () => import('@/views/System/Login/index.vue'),
    meta: { title: '登录', full: true, hidden: true },
  },

  {
    path: REDIRECT_PAGE_URL, // 重定向页
    name: 'Redirect',
    component: DEFAULT_LAYOUT,
    meta: { full: false, hidden: true },
    children: [
      {
        // path: `${REDIRECT_PAGE_URL}/:path(.*)`,
        path: `:path(.*)`,
        component: () => import('@/views/System/Redirect/index.vue'),
      },
    ],
  },

  {
    path: '/404', // The not found page must be placed last
    component: () => import('@/views/System/ExceptionPage/NotFound.vue'),
    meta: { hidden: true },
    alias: '/:pathMatch(.*)*',
  },
]

// export const DYNAMIC_ROUTE_LIST: Array<RouteRecordRaw> = [
//   {
//     path: '/System',
//     name: 'System',
//     component: DEFAULT_LAYOUT,
//     meta: { title: '系统管理', alwaysShow: true, icon: 'Monitor' },
//     children: [
//       {
//         path: 'User',
//         component: () => import('@/views/System/User/index.vue'),
//         meta: { title: '用户管理', icon: 'User' },
//       },
//       {
//         path: 'Role',
//         component: () => import('@/views/System/Role/index.vue'),
//         meta: { title: '角色管理', icon: 'Role' },
//       },
//       {
//         path: 'Menu',
//         component: () => import('@/views/System/Menu/index.vue'),
//         meta: { title: '菜单管理', icon: 'Menu' },
//       },
//     ],
//   },

//   {
//     path: '/Monitor',
//     name: 'Monitor',
//     component: DEFAULT_LAYOUT,
//     meta: { title: '系统监控', alwaysShow: true, icon: 'Monitor' },
//     children: [
//       {
//         path: 'Online',
//         component: () => import('@/views/Monitor/Online/index.vue'),
//         meta: { title: '在线用户', icon: 'User' },
//       },
//       {
//         path: 'Logininfor',
//         component: () => import('@/views/Monitor/Logininfor/index.vue'),
//         meta: { title: '登录日志', icon: 'Dice' },
//       },
//     ],
//   },

//   {
//     path: '/Resource',
//     name: 'Resource',
//     component: DEFAULT_LAYOUT,
//     meta: { title: '资源管理', alwaysShow: true, icon: 'Resource' },
//     children: [
//       {
//         path: 'IconView',
//         component: () => import('@/views/Resource/IconView/index.vue'),
//         meta: { title: '内置图标', icon: 'Dice' },
//       },
//     ],
//   },
// ]
